<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
		<link rel="stylesheet" href="{:ADDON_PUBLIC_PATH}/css/weuix.min.css">
		<link rel="stylesheet" href="{:ADDON_PUBLIC_PATH}/css/header_common.css" />
		<link rel="stylesheet" href="{:ADDON_PUBLIC_PATH}/css/comment_New.css" />
		<script src="{:ADDON_PUBLIC_PATH}/js/zepto.min.js"></script>
		<script src="{:ADDON_PUBLIC_PATH}/js/common.js"></script>
	</head>

	<body>
		<!--导航栏-->
		<div class="weui_btn_default weui-header">
			<div class="weui-header-left">
				<a href="javascript: window.history.go(-1);" class="icon icon-109 f-blue"></a>
			</div>
			<h1 class="weui-header-title f-black">评论</h1>
		</div>
		<!--评论输入框-->
		<div class="weui_cells_title">评论</div>
		<form action="" method="post" >
			<div class="weui_cells moments comment_interval">
			<!-- 普通的post -->
			<div class="weui_cell moments__post">
				<div class="weui_cell_hd">
					<img class="circle" src="{$data['headimgurl']}">
				</div>
				<div class="weui_cell_bd">
					<!-- 人名链接 -->
					<a class="title" href="javascript:;">
						<span>{$data['nickname']}</span>
					</a>
				</div>
				<div class="weui_cells weui_cells_form">
					<div class="weui_cell">
						<div class="weui_cell_bd weui_cell_primary">
							<textarea id="textarea" class="weui_textarea" placeholder="写下你独特的见解吧" rows="3" name="content"></textarea>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="page-bd-15">
			<input type="submit"  class="weui_btn weui_btn_primary ajax-post">
		</div>
		</form>
	<script>
          $(document).on('click', '.ajax-post', function() {
          	$.showLoading();
		    var data = $('form').serialize();
		    var url = $('form').attr('action');
		   	$.ajax({
			    url:url,
			    type:"post",
			    dataType:"json",
			    data:data,
			    success:function(data){
			     	$.hideLoading();
		            console.log(data);
		            if (data.status == 1) {
		                 $.toast(data.info); 
		                 setTimeout(function(){
		                 	//  history.pushState("","","{:U('booksDetail',array('bid'=>I('get.bid')))}");  
		                 	location.href = "{:U('studInfo',array('aid'=>I('get.aid')))}";
		                 	// window.history.go(-1);
		                 },1500);
		            } else {
		                 $.toast(data.info, "forbidden");
		            }
			    },
			    error:function(){
			      	$.toast("错误", "forbidden");
			    }
			});
		    return false;
		})
	</script>
	</body>

</html>